package routines;

public class DAOBankInfo extends DAO{

	public static BankInfo getByBIC(String bic) throws Exception{
		CheckSession();
		if(bic==null)
			throw new Exception("bic can not be null!");
		BankInfo c = (BankInfo) session.createQuery("from BankInfo where bic = :bic").setString("bic", bic).uniqueResult();
		return c;
	}

	public static BankInfo getByRegnumber(String regnum) throws Exception{
		CheckSession();
		if(regnum==null)
			throw new Exception("Regnumber can not be null!");
		BankInfo c = (BankInfo) session.createQuery("from BankInfo where regnumber = :regnum").setString("regnum", regnum).uniqueResult();
		return c;
	}


}
